bitkeeper revision 1.1159.223.6 (41ee77cbILw-JaVF0uno2Fd5_A-GiQ)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 19 Jan 2005 15:07:55 +0000 (15:07 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 19 Jan 2005 15:07:55 +0000 (15:07 +0000)
Fix error path in console-driver initilaisation. Remove module
destructor as the console driver cannot be built as a module.

linux-2.6.10-xen-sparse/drivers/xen/console/console.c

index 514969cb4de285721ac2589edb88dace204fd3cd..b9c09c3d73da003644f1ec9479c4eb43efe97961 100644 (file)
@@ -738,8 +738,13 @@ static int __init xencons_init(void)
 
     if ( (rc = tty_register_driver(DRV(xencons_driver))) != 0 )
     {
-        printk("Couldn't register Xen virtual console driver as %s\n",
-               DRV(xencons_driver)->name);
+        printk("WARNING: Failed to register Xen virtual "
+               "console driver as '%s%d'\n",
+               DRV(xencons_driver)->name, DRV(xencons_driver)->name_base);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+        put_tty_driver(xencons_driver);
+        xencons_driver = NULL;
+#endif
         return rc;
     }
 
@@ -764,27 +769,4 @@ static int __init xencons_init(void)
     return 0;
 }
 
-static void __exit xencons_fini(void)
-{
-    int ret;
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-    tty_unregister_device(xencons_driver, 0);
-#endif
-
-    if ( (ret = tty_unregister_driver(DRV(xencons_driver))) != 0 )
-        printk(KERN_ERR "Unable to unregister Xen console driver: %d\n", ret);
-
-    if ( xen_start_info.flags & SIF_INITDOMAIN )
-    {
-        free_irq(xencons_priv_irq, NULL);
-        unbind_virq_from_irq(VIRQ_CONSOLE);
-    }
-    else
-    {
-        ctrl_if_unregister_receiver(CMSG_CONSOLE, xencons_rx);
-    }
-}
-
 module_init(xencons_init);
-module_exit(xencons_fini);